An image scanner is generally known. The image scanner acquires line image data that is image data of one line of three colors including red, blue, and green by, while moving a reading position of a line sensor to the downstream side in the reading direction, emitting light while switching color of a light source of the three colors in a predetermined emitting sequence and reading an image.
In this image scanner, the reading positions of red, blue, and green differ by ⅓ for each color in the emitting sequence. In this image scanner, a case is considered in which the light source is controlled to emit light by switching the color of the light source in the emitting sequence in which green is the first color, blue is the second color, and red is the third color, for example. In this image scanner, in a case where the image at the reading position changes from a white background color image to a black image in the middle of emitting blue light, the white image is read when emitting green light that is the first color in the emitting sequence, and the black image is read when emitting red light that is the third color in the emitting sequence. Thus, green image data has a large output and red image data has a small output, and hence line image data of cyan or similar color is acquired. Further, in this image scanner, in a case where the image at the reading position changes from a black image to a white background color image in the middle of emitting blue light, the black image is read when emitting green light that is the first color in the emitting sequence, and the white image is read when emitting red light that is the third color in the emitting sequence. Thus, green image data has a small output and red image data has a large output, and hence line image data of magenta or similar color is acquired. In this way, in this image scanner, in a case of reading a boundary between a white background color image and a black image, images of different colors are read when light of the first color is emitted and when light of the third color is emitted, which may cause occurrence of a color shift. The color shift that occurs in the first color occurs because the reading position of the first color is shifted from the reading position of the second color by ⅓ line to the upstream side in the reading direction. The color shift that occurs in the third color occurs because the reading position of the third color is shifted from the reading position of the second color by ⅓ line to the downstream side in the reading direction.
In order to correct the color shift that occurs because the reading position of the first color is shifted from the reading position of the second color by ⅓ line to the upstream side in the reading direction or because the reading position of the third color is shifted from the reading position of the second color by ⅓ line to the downstream side in the reading direction, the above-mentioned image scanner generates image data of the first color of a certain line by using image data of the first color of the read line, image data of the first color of the line prior to the read line, and image data of the first color of the line subsequent to the read line, and further generates image data of the third color of the line by using image data of the third color of the read line, image data of the third color of the line prior to the read line, and image data of the third color of the line subsequent to the read line.